<template>
    <div>
        <!-- <order-swiper :topImages = "topImages" v-if="topImages!=''" /> -->
        <el-table :data="tableData" border style="width: 100%" >
            <el-table-column prop="date" label="日期" width="150" />
            <el-table-column prop="name" label="景点名字" width="120" />
            <el-table-column prop="totalMoney" label="总金额/￥" width="100" />
            <el-table-column prop="num" label="数量" width="50" />
            <el-table-column prop="status" label="状态" width="120"/>
            <el-table-column prop="orderId" label="订单编号" width="150" />
            <el-table-column fixed="right" label="操作" width="100">
            <template slot-scope="scope">
                <el-button @click="handleClick(scope.row)" type="text" size="small">查看</el-button>
                <el-button @click="refundClick(scope.row)" type="text" size="small">退款</el-button>
                <el-button @click="qrCodeClick(scope.row)" type="text" size="small">二维码</el-button>
                <!-- <el-button @click="refundClick(scope.row)" type="text" size="small">退款</el-button> -->
            </template>
            </el-table-column>
        </el-table>
        <el-dialog :title="paySucc?'不看就不看呗':imageName" :visible.sync="dialogVisible" width="100%" center >
            <order-swiper :topImages = "topImages" v-if="topImages!=''" />
        </el-dialog>
    </div>
</template>

<script>
import OrderSwiper from './OrderSwiper'
export default {
    data() {
        return {
            topImages: [],
            dialogVisible: false,
            paySucc: false,
            imageName: '',
        }
    },
    props: {
        tableData: {
            type: Array,
            default: []
        }
    },
    components: {
            OrderSwiper,
    },
    methods: {
        handleClick(row) {
            this.topImages = row.slideShow;
            this.dialogVisible = true;
            this.imageName = row.name;
        },
        qrCodeClick(row) {
            this.$emit('qrCodeClick',row);
        },
        refundClick(row) {
            if(row.status !== '待评价') {
                this.$toast.show("没付钱退尼玛钱呢");
            }else{
                this.$emit('refundClick',row);
            }
        }
    },
  }
</script>
<style scoped>

</style>